<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:include="common::common(title='基础数据')">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" ></meta>
</head>
<script type="text/javascript" th:src="@{/js/basic/baseseCodingRule.js}"></script>
<body>
<div id="app" v-cloak>
  <el-container >
	<el-header height="45px" class="inner_header">
	    	<el-form ref="form" :model="queryData" label-width="50px"  :label-position="labelPosition" >
		    	<el-row :gutter="20">
				  <el-col :span="5">
				  		<el-form-item label="编码名称:">
					  		<el-input placeholder="请输入名称" v-model="queryData.codingName" size="mini" clearable>
							</el-input>
						</el-form-item>
				  </el-col>
				  <el-col :span="5">
				  	<el-form-item>
				  		<el-button type="primary" size="mini" icon="el-icon-search" @click="search">查询</el-button>
				  		<el-button type="primary" size="mini" icon="el-icon-plus" @click="addItem">增加</el-button>
				  	</el-form-item>
				  </el-col>
				</el-row>
	    	</el-form>
	    </el-header>
	    <el-main class="inner_main">
	    	<div class="query_tool_bar">
	    	  <el-table  
	    	    ref="baseseCodingRuleDatagrid" 
	    	    :data="datagrid"
			    tooltip-effect="dark"
			    style="width: 100%;"
			    :height="tableHeight"
			    @row-click="datagridSelect"
			    border
			    highlight-current-row
			    >
			    	<el-table-column type="index" label="序号" width="50" header-align="center"></el-table-column>
				    <el-table-column prop="codingName" label="编码名称"  header-align="center"> </el-table-column>
				    <el-table-column prop="codingRule" label="编码规则"  header-align="center"> </el-table-column>
				    <el-table-column prop="resetModeName" label="归零方式" header-align="center"> </el-table-column>
				    <el-table-column prop="currentValue" label="当前值"  header-align="center"> </el-table-column>
				    <el-table-column prop="createByName" label="操作人"   header-align="center"> </el-table-column>
				    <el-table-column prop="createDate" label="操作时间"  header-align="center"> </el-table-column>
				    <el-table-column  label="操作"  fixed="right" width="150">
				    	<template slot-scope="scope" >
					        <el-button type="primary" size="mini"  @click="editItem(scope.row)">编辑</el-button>
					        <el-button type="danger" size="mini"  @click="deleteItem(scope.row)">删除</el-button>
					      </template>
				    </el-table-column>
			  </el-table>
			</div>
			<div class="pagination_wrap">
			    <el-pagination
			      :current-page="queryData.page"
			      :page-sizes="[10, 20, 40, 100]"
			      :page-size="queryData.rows"
			      :layout="pagination_layout"
			      :total="totalNum"
			      @size-change="handleSizeChange"
			      @current-change="handleCurrentChange"
			      @prev-click="handlePrevClick"
			      @next-click="handleNextClick">
			    </el-pagination>
			 </div>
	    </el-main>
	</el-container>
	<!-- dialog 开始 不需要【删除】 -->
	<el-dialog :visible.sync="dialogConfig.dialogFormVisible" :close-on-click-modal="false" :show-close="false" fullscreen >
		  <el-form :model="addData" ref="dialogForm" :rules="rules">
	      	<el-form-item label="编码名称" prop="codingName" 
	      		:label-width="dialogConfig.formLabelWidth">
		      <el-input v-model="addData.codingName"  auto-complete="off" style="width:220px;"></el-input>
		    </el-form-item>
	      	<el-form-item label="编码规则" prop="codingRule" 
	      		:label-width="dialogConfig.formLabelWidth">
		      <el-input v-model="addData.codingRule"  auto-complete="off" style="width:220px;"></el-input>
		    </el-form-item>
	      	<el-form-item label="归零方式" prop="resetModeCode" 
	      		:label-width="dialogConfig.formLabelWidth">
			      <el-select v-model="addData.resetModeCode" @change="resetModeChange" size="mini">
				    <el-option
				      v-for="item in resetModeData"
				      :key="item.id"
				      :label="item.text"
				      :value="item.id">
				    </el-option>
				 </el-select>
		    </el-form-item>
	      	<el-form-item label="归零值" prop="resetValue" 
	      		:label-width="dialogConfig.formLabelWidth">
		      <el-input v-model="addData.resetValue"  auto-complete="off" style="width:220px;"></el-input>
		    </el-form-item>
		  </el-form>
		  <div slot="footer" class="dialog-footer">
		    <el-button @click="closeDialog">取 消</el-button>
		    <el-button type="primary" @click="submitForm('dialogForm')">确 定</el-button>
		  </div>
	 </el-dialog>
	 <!-- dialog 结束 -->
</div>
</body>
</html>